package cn.team11.smarteye.fragment;

import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import cn.team11.sds.dayi.R;

import cn.team11.smarteye.base.BaseDialog;

/**
 * Created by Murphy on 2017/11/3.
 */

public class TextDialogFragment extends BaseDialog{

    private TextView mTxtEt;

    public TextDialogFragment() {
        super();
    }

    public static TextDialogFragment newInstance(Bundle bundle) {
        TextDialogFragment fragment = new TextDialogFragment();
        fragment.setArguments(bundle);
        return fragment;
    }

    @NonNull
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        return super.onCreateDialog(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.dialog_text_content, container, false);
        mTxtEt = (TextView) view.findViewById(R.id.text_tv);
        setContent(view);
        setTitle(getArguments().getString("title"));
        mTxtEt.setText(getArguments().getString("content"));
        //setTitle(getActivity().getResources().getString(R.string.device_remote_restart));
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    public void setContentText(String string){
        if (mTxtEt != null) mTxtEt.setText(string);
    }
}
